// File generated from our OpenAPI spec by Stainless.

package com.metest.api.services.blocking.rest.actuator

import com.google.errorprone.annotations.MustBeClosed
import com.metest.api.core.ClientOptions
import com.metest.api.core.RequestOptions
import com.metest.api.core.http.HttpResponseFor
import com.metest.api.models.rest.actuator.metrics.MetricListParams
import com.metest.api.models.rest.actuator.metrics.MetricListResponse
import com.metest.api.models.rest.actuator.metrics.MetricRetrieveByNameParams
import com.metest.api.models.rest.actuator.metrics.MetricRetrieveByNameResponse
import java.util.function.Consumer

interface MetricService {

    /**
     * Returns a view of this service that provides access to raw HTTP responses for each method.
     */
    fun withRawResponse(): WithRawResponse

    /**
     * Returns a view of this service with the given option modifications applied.
     *
     * The original service is not modified.
     */
    fun withOptions(modifier: Consumer<ClientOptions.Builder>): MetricService

    /** Actuator web endpoint 'metrics' */
    fun list(): MetricListResponse = list(MetricListParams.none())

    /** @see list */
    fun list(
        params: MetricListParams = MetricListParams.none(),
        requestOptions: RequestOptions = RequestOptions.none(),
    ): MetricListResponse

    /** @see list */
    fun list(params: MetricListParams = MetricListParams.none()): MetricListResponse =
        list(params, RequestOptions.none())

    /** @see list */
    fun list(requestOptions: RequestOptions): MetricListResponse =
        list(MetricListParams.none(), requestOptions)

    /** Actuator web endpoint 'metrics-requiredMetricName' */
    fun retrieveByName(requiredMetricName: String): MetricRetrieveByNameResponse =
        retrieveByName(requiredMetricName, MetricRetrieveByNameParams.none())

    /** @see retrieveByName */
    fun retrieveByName(
        requiredMetricName: String,
        params: MetricRetrieveByNameParams = MetricRetrieveByNameParams.none(),
        requestOptions: RequestOptions = RequestOptions.none(),
    ): MetricRetrieveByNameResponse =
        retrieveByName(
            params.toBuilder().requiredMetricName(requiredMetricName).build(),
            requestOptions,
        )

    /** @see retrieveByName */
    fun retrieveByName(
        requiredMetricName: String,
        params: MetricRetrieveByNameParams = MetricRetrieveByNameParams.none(),
    ): MetricRetrieveByNameResponse =
        retrieveByName(requiredMetricName, params, RequestOptions.none())

    /** @see retrieveByName */
    fun retrieveByName(
        params: MetricRetrieveByNameParams,
        requestOptions: RequestOptions = RequestOptions.none(),
    ): MetricRetrieveByNameResponse

    /** @see retrieveByName */
    fun retrieveByName(params: MetricRetrieveByNameParams): MetricRetrieveByNameResponse =
        retrieveByName(params, RequestOptions.none())

    /** @see retrieveByName */
    fun retrieveByName(
        requiredMetricName: String,
        requestOptions: RequestOptions,
    ): MetricRetrieveByNameResponse =
        retrieveByName(requiredMetricName, MetricRetrieveByNameParams.none(), requestOptions)

    /** A view of [MetricService] that provides access to raw HTTP responses for each method. */
    interface WithRawResponse {

        /**
         * Returns a view of this service with the given option modifications applied.
         *
         * The original service is not modified.
         */
        fun withOptions(modifier: Consumer<ClientOptions.Builder>): MetricService.WithRawResponse

        /**
         * Returns a raw HTTP response for `get /rest/actuator/metrics`, but is otherwise the same
         * as [MetricService.list].
         */
        @MustBeClosed
        fun list(): HttpResponseFor<MetricListResponse> = list(MetricListParams.none())

        /** @see list */
        @MustBeClosed
        fun list(
            params: MetricListParams = MetricListParams.none(),
            requestOptions: RequestOptions = RequestOptions.none(),
        ): HttpResponseFor<MetricListResponse>

        /** @see list */
        @MustBeClosed
        fun list(
            params: MetricListParams = MetricListParams.none()
        ): HttpResponseFor<MetricListResponse> = list(params, RequestOptions.none())

        /** @see list */
        @MustBeClosed
        fun list(requestOptions: RequestOptions): HttpResponseFor<MetricListResponse> =
            list(MetricListParams.none(), requestOptions)

        /**
         * Returns a raw HTTP response for `get /rest/actuator/metrics/{requiredMetricName}`, but is
         * otherwise the same as [MetricService.retrieveByName].
         */
        @MustBeClosed
        fun retrieveByName(
            requiredMetricName: String
        ): HttpResponseFor<MetricRetrieveByNameResponse> =
            retrieveByName(requiredMetricName, MetricRetrieveByNameParams.none())

        /** @see retrieveByName */
        @MustBeClosed
        fun retrieveByName(
            requiredMetricName: String,
            params: MetricRetrieveByNameParams = MetricRetrieveByNameParams.none(),
            requestOptions: RequestOptions = RequestOptions.none(),
        ): HttpResponseFor<MetricRetrieveByNameResponse> =
            retrieveByName(
                params.toBuilder().requiredMetricName(requiredMetricName).build(),
                requestOptions,
            )

        /** @see retrieveByName */
        @MustBeClosed
        fun retrieveByName(
            requiredMetricName: String,
            params: MetricRetrieveByNameParams = MetricRetrieveByNameParams.none(),
        ): HttpResponseFor<MetricRetrieveByNameResponse> =
            retrieveByName(requiredMetricName, params, RequestOptions.none())

        /** @see retrieveByName */
        @MustBeClosed
        fun retrieveByName(
            params: MetricRetrieveByNameParams,
            requestOptions: RequestOptions = RequestOptions.none(),
        ): HttpResponseFor<MetricRetrieveByNameResponse>

        /** @see retrieveByName */
        @MustBeClosed
        fun retrieveByName(
            params: MetricRetrieveByNameParams
        ): HttpResponseFor<MetricRetrieveByNameResponse> =
            retrieveByName(params, RequestOptions.none())

        /** @see retrieveByName */
        @MustBeClosed
        fun retrieveByName(
            requiredMetricName: String,
            requestOptions: RequestOptions,
        ): HttpResponseFor<MetricRetrieveByNameResponse> =
            retrieveByName(requiredMetricName, MetricRetrieveByNameParams.none(), requestOptions)
    }
}
